<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>热门微博</title>
<link rel="stylesheet" type="text/css" href="css/other.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="iecss.css" />
<![endif]-->
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/home.js"></script>
<script type="text/javascript" src="js/weibo_ajax.js"></script>
<script type="text/javascript" src="js/weibo_counter.js"></script>
<script type="text/javascript" src="js/collection.js"></script>
<script type="text/javascript" src="js/transpond_hotweibo.js"></script>
<script type="text/javascript" src="js/comment_hotweibo.js"></script>

<script type="text/javascript">     
//<![CDATA[
$(function(){
var $div_li =$("div.hot_tab_menu ul li");
$div_li.click(function(){
$(this).addClass("selected")            //当前<li>元素高亮
.siblings().removeClass("selected");  //去掉其它同辈<li>元素的高亮
var index =  $div_li.index(this);  // 获取当前点击的<li>元素 在 全部li元素中的索引。
$("div.hot_tab_box > div")   	//选取子节点。不选取子节点的话，会引起错误。如果里面还有div
.eq(index).show()   //显示 <li>元素对应的<div>元素
.siblings().hide(); //隐藏其它几个同辈的<div>元素
}).hover(function(){
$(this).addClass("hover");
},function(){
$(this).removeClass("hover");
})
})
//]]>

$(function(){       
	/*重新计算微博框剩余可输入字数*/
   	$("#speach_content").bind("blur focus keydown keypress keyup", function(){           
   		recount($("#counter"),$("#speach_submit"),$("#speach_content"));       
	});
   	$("#speach_submit").click(function(){
   		recount($("#counter"),$("#speach_submit"),$("#speach_content")); 
   		$("#picture").hide();
   	});
   	/*重新计算转发框剩余可输入字数*/
   	$("#zhuanfa_info").bind("blur focus keydown keypress keyup", function(){        
   		recount($(this).prev(".zhuanfa_tips").find("#counter"),$(this).next("#zhuanfa_submit"),$(this)); 
	});
 	/*隐藏与打开评论框*/ 
   	$("div#comment_box").hide();

   	$(".weibo_button a:contains('评论')").live('click',function(){
		$(this).parent().nextAll("#comment_box").toggle();
		return false;
	}); 

   	/*关闭与打开转发框*/
	$("#zhuanfa_box").hide();
	
	$(".weibo_button a:contains('转发')").live('click',function(){
		var tWindow = $(this).parent().nextAll("#zhuanfa_box");
		var tFace = $(this).parent().nextAll("#transpond_face");
		$("#mask").toggle();
		showDialog(tWindow,tFace);
		tWindow.toggle();
		return false;
	}); 
	$("#zhuanfa_box .zhuanfa_titlebox .zhuanfa_close a").live('click',function(){
		$(this).parents("#zhuanfa_box").hide();
		$(this).parents("#zhuanfa_box").nextAll("#transpond_face").hide();
		$("#mask").hide();
	});
	/*打开转发框表情框*/
	$("#zhuanfa_box #speach_expression").live('click',function(){
		$(this).parent().next("#transpond_face").toggle();
		return false;
	});
	$("#transpond_face .face_close").live('click',function(){
		$("#transpond_face").hide();	
	});
	/*
	*根据当前页面与滚动条位置，设置转发框的top与left
	*/
	function showDialog(subWindow,face){
		var objW = $(window);	//当前窗口
		var objT = subWindow;	//要显示的对话框
		var objF = face;
		var brsW = objW.width();	//当然窗口的宽
		var brsH = objW.height();	//当前窗口的高
		var sclL = objW.scrollLeft();	//当前窗口滚动条相对最左位置
		var sclT = objW.scrollTop();	//当前窗口滚动条相对最上位置
		var curW = objT.width();	//对话框的宽
		var curH = objT.height();	//对话框的高

		//计算对话框居中时的左边距
		var tLeft = sclL + (brsW - curW) / 2;
		//计算对话框居中时的上边距
		var tTop = sclT + (brsH - curH) / 2;
		//表情框左边距
		var fLeft = sclL + (brsW - curW) / 2;
		//表情框上边距
		var fTop = sclT + (brsH - curH) / 2 + curH + 10;
		//设置对话框在页面中的位置
		objT.css({"left": tLeft, "top": tTop});
		objF.css({"left": fLeft, "top": fTop, "width": curW});
	}
	/*当前窗口大小改变时，改变转发框的位置*/
	$(window).resize(function()	{
		if(!$("#zhuanfa_box").is(":visible")) {
			return;
		}
		showDialog($("#zhuanfa_box"),$("#transpond_face"));
	});

	/*打开表情框*/
	$("#speach #speach_expression_w,#speach #speach_expression").click(function(){
		$("#face").toggle();
		return false;
	});
	$(":not(#face,#speach_expression_w,#speach_expression)").click(function(){
		$("#face").hide();
	});
	$(".face_close").click(function(){
		$("#face").hide();	
	});
	
	/*打开图片上传框*/
	$("#speach #speach_picture_w,#speach #speach_picture").click(function(){
		$("#picture").toggle();
		var str = "*发布图片*";
		var obj = $("#speach_content").get(0);
		if (document.selection) {
			obj.focus();
		    var sel = document.selection.createRange();
		    sel.text = str;
		} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
				var startPos = obj.selectionStart;
				var endPos = obj.selectionEnd;
				var tmpStr = obj.value;
				obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
		} else {           
			obj.value += str;
		}
		recount($("#counter"),$("#speach_submit"),$("#speach_content")); 
		return false;
	});
	$("#picture .picture_close").click(function(){
		$("#picture").hide();	
	});

	/*微博框插入表情*/
	$("#speach #face .face_content img").click(function(){
		var strL = "[";
		var strR = "]";
		var str = strL + $(this).attr("name") + strR;
		var obj = $("#speach_content").get(0);
		if (document.selection) {
			obj.focus();
		    var sel = document.selection.createRange();
		    sel.text = str;
		} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
				var startPos = obj.selectionStart;
				var endPos = obj.selectionEnd;
				var tmpStr = obj.value;
				obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
		} else {           
			obj.value += str;
		}
		recount($("#counter"),$("#speach_submit"),$("#speach_content")); 	
	});

	/*转发框插入表情*/
	$("#transpond_face .face_content img").live('click',function(){
		var strL = "[";
		var strR = "]";
		var str = strL + $(this).attr("name") + strR;
		var obj = $(this).parents("#transpond_face").prev("#zhuanfa_box").find("#zhuanfa_info").get(0);
		if (document.selection) {
			obj.focus();
		    var sel = document.selection.createRange();
		    sel.text = str;
		} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
				var startPos = obj.selectionStart;
				var endPos = obj.selectionEnd;
				var tmpStr = obj.value;
				obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
		} else {           
			obj.value += str;
		}
		recount($(this).parents("#transpond_face").prev("#zhuanfa_box").find("#counter"),$("#zhuanfa_submit"),$(this).parents("#transpond_face").prev("#zhuanfa_box").find("#zhuanfa_info"));	
	});
	$(".friend_accept a").hover(function(){
		$(this).css("color","#ffffff");
	},function(){
		$(this).css("color","#000000");
		});

	/*搜索框控制*/
	$("#searchinfo").focus(function(){
		$("#searchinfo").val("");
	});
	$("#searchinfo").blur(function(){
		if(!$("#searchinfo").val()){
			$("#searchinfo").val("找微博,找人");
		}
	});
	$("#search").click(function(){
		if(!$("#searchinfo").val()){
			return false;
		}
		else if($("#searchinfo").val() == "找微博,找人"){
			return false;
		}
		else{	
			return true;
		}
	});
	/*放大图片*/
	$(".weibo_photo img").live('click',function(){
		if($(this).attr("width") == "150"){
			$(this).attr("width","400");
		}
		else $(this).attr("width","150");
	});
	$(".weibo_t_photo img").live('click',function(){
		if($(this).attr("width") == "150"){
			$(this).attr("width","400");
		}
		else $(this).attr("width","150");
	});
}); 
</script>
</head>
<body onload="startdate(),startTime()">

<?php
include_once 'msg_redirect.php';	/*通过使用cookie，当检查出未登陆，则不予进入home.php，返回index.php*/
if($_COOKIE['TTU'] != "logined"){
	msg_redirect("您还未登录哦！", "index.php");
}?>
<div id="mask"></div>
<div id="main_container">

	<div id="header" >

       <div class="top_right">
       
            <div class="weather">
              <div class="weather_text" id="date"></div>
              <div class="weather_text" id="time"></div>
              <div class="weather_img">
              <a href="#"><img src="image/w_cloudy.png" border="0" width="60" height="60"/></a></div>
            </div>
            
            <div class="big_banner">
            <a href="#"><img src="image/life.jpg" border="0" width="180" height="100"/></a>
            <a href="#"><img src="image/love.jpg"  border="0" width="180" height="100"/></a>
            <a href="#"><img src="image/reading.jpg" border="0" width="180" height="100"/></a>
         </div>
        
        </div>
    
  
        <div id="logo">
            <a href="index.html"><img src="image/logo.png" alt="" title="" border="0" width="240" height="125" /></a>
	    </div>
        

        

    </div>
    
   <div id="main_content"> 
   
            <div id="menu_tab">
                    <ul id="menu">
                    	<li><a href="home.php">首 页</a></li>
                        <li><a href="#">热 门  <img src="image/more.png" /></a>
                         	<ul>
        						<li><a href="hotpeople.php">微博达人</a></li>
        						<li><a href="hotweibo.php">热门微博</a></li>
      						</ul>
                      </li>
                         <li><a href="#">应 用 <img src="image/more.png" /></a>
                         	<ul>
        						<li><a href="photo.php">相册</a></li>
        						<li><a href="collection.php">收藏</a></li>
                                <li><a href="find.php">找人</a></li>
        						<li><a href="#">我的课表</a></li>
        						<li><a href="#">公文通</a></li>
      						</ul>
                         </li>                                                   
                         <li><a href="my_weibo.php">我的主页</a></li>

                         <li><a href="#">消 息  <img src="image/more.png" /></a>
                         	<ul>
        						<li><a href="comment.php">查看评论</a></li>
        						<li><a href="cencerns_from.php">查看粉丝</a></li>
        						<li><a href="my_concerns.php">查看关注</a></li>
      						</ul>
                         </li>                     
                         <li><a href="#">帐 号  <img src="image/more.png" /></a>
                         	<ul>
        						<li><a href="account_info">帐号设置</a></li>
        						<li><a href="logout.php">注销</a></li>
      						</ul>
                         </li>
                         
                    </ul>

            </div><!-- end of menu tab -->
            
    



   <div class="center_content">
     <div class="center_title"><img src="image/hot_title.png" width="200" height="60"/></div>
     <div class="hot_tab">
		<div class="hot_tab_menu">
		<ul>
		<li class="selected">热门转发</li>
		<li>热门评论</li>
		</ul>
		</div>
	<div class="hot_tab_box">
    	<div>
        <div id="weibo_box"><?php 
    /*循环输出热门转发的内容，同时输出头像，昵称，发布微博的时间*/
    include_once 'sql_connect.php'; 
    include_once 'msg_redirect.php';
	$u_no = $_COOKIE['u_no'];
    
    $my_sql = mysql_query("SELECT * FROM weibo  ORDER by t_times DESC LIMIT 0,10",$connection);
		
    $my_result = mysql_fetch_array($my_sql);
    if($my_result){
    do{
    ?>
   	<div class="weibo_box">
   		<span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
    	<div class="hot_img">
        <div class="hot_img1"><?php 
                           /*显示转发次数*/
                           include_once("sql_connect.php");                                            
                            $w_id = $my_result[w_id];
                            /*检查weibo表中w_id（微博id）最大t_times（微博转发次数）*/
                            $weibo_sql = mysql_query("select t_times from weibo WHERE w_id = '$w_id'",$connection);	
                            $weibo_result = mysql_fetch_array($weibo_sql);
    						$weibo_data = $weibo_result[0];   						
    						echo "$weibo_data";
    						?></div>
        <div class="hot_img2">转发</div>
        </div>
        <div class="weibo_content">        
        	   <?php
        	    /*输出昵称和微博内容*/ 
        	    include_once 'utilities/show_expression.php';
        	    include_once 'sql_connect.php';
        	    $u_no = $my_result['u_no'];
        	   	$user_sql = mysql_query("select u_name from user_info where u_no='$u_no'",$connection);
    			$user_result = mysql_fetch_array($user_sql);
    			$user_data = $user_result[0];   						
	    		echo "<font color='#06f'>".$user_data."</font>".": ".show_expression($my_result[w_content]);
	    		?>
	    
	    <?php 
        /*转发的显示*/
        include_once("sql_connect.php");
        
        $t_id = $my_result[t_id];
        
        if($t_id !="0"){
        	do{
        	include_once("sql_connect.php");
      	
        	$weibo_sql= mysql_query("SELECT weibo.u_no,w_content,w_date,u_name,h_id,w_id,t_id,p_id FROM weibo,user_info WHERE w_id='$t_id' AND user_info.u_no IN(SELECT u_no FROM weibo WHERE w_id='$t_id')");
        	$weibo_result2= mysql_fetch_array($weibo_sql);
        	
        	$t_id =$weibo_result2[t_id];
        	/*判断是不是最终的微博*/
        	if($t_id =="0"){ 
        	/*最终的微博,另开一个框*/ ?>
       	    <div class='weibo_t_content'>
            <div class='weibo_t_bg'> 
			<?php   
        	include_once 'utilities/show_expression.php';
	        echo "<font color='#06f'>"."@".$weibo_result2[u_name]."</font>".": ".show_expression($weibo_result2[w_content]);
	      
				        
	        ?>
            
			<div class='weibo_t_photo'><img <?php if($weibo_result2[p_id]!="0"){
								/*输出相片*/
        						include_once 'sql_connect.php'; 
        						$p_id= $weibo_result2['p_id'];
    							$photo_sql2 = mysql_query("select p_data from photo where p_id='$p_id'",$connection);
    							$photo_result2 = mysql_fetch_array($photo_sql2);
    							$my_data = $photo_result2[p_data];
    							echo "src='";
    							echo "$my_data";   
								echo "'"." width='150'";			
									}	?> /></div>
			<div class='weibo_t_button'>转发(<?php 
                           /*显示转发次数*/
                           include_once("sql_connect.php");                                            
                            $w_id = $weibo_result2[w_id];
                            /*检查weibo表中w_id（微博id）最大t_times（微博转发次数）*/
                            $weibo_sql = mysql_query("select t_times from weibo WHERE w_id = '$w_id'",$connection);	
                            $weibo_result = mysql_fetch_array($weibo_sql);
    						$weibo_data = $weibo_result[0];   						
    						echo "$weibo_data";
    						?>)&nbsp;|&nbsp;评论(<?php 
    						/*显示评论次数*/
                           include_once("sql_connect.php");                   
                            $w_id = $weibo_result2[w_id];
                            /*检查comment表中w_id（微博id）最大w_ctimes（微博评论次数）*/
                            $comment_sql = mysql_query("select MAX(w_ctimes) from comment WHERE w_id = '$w_id'",$connection);	
                            $comment_result = mysql_fetch_array($comment_sql);
    						$comment_data = $comment_result[0];  
    						if ($comment_data){
    							echo "$comment_data";
    						}
    						echo "0";
    						?>)</div> 
			<div class='weibo_t_time'> <?php include_once 'timeConverter.php';	echo timeConverter($weibo_result2[w_date]);?></div>	    	 
			<s><i></i></s>
            </div> 
			</div> <?php 
        	} 
        	else {	            
        	/*如果不是最终微博,则直接输出*/	       
        	echo "<span class=''>";        
        	include_once 'utilities/show_expression.php';
	    	echo "<font color='#06f'>"."@".$weibo_result2[u_name]."</font>".": ".show_expression($weibo_result2[w_content]);
	   		echo " </span> ";	
        	}
        	
        	
        	}while($t_id);
        }
        ?>    
	    
        </div>
        <?php 
        $p_id= $my_result['p_id'];
        if($p_id!="0"){
        
        ?>
        
        <div class="weibo_photo"><img src="<?php
        						/*输出相片*/
        						include_once 'sql_connect.php'; 
        						$p_id= $my_result['p_id'];
    							$photo_sql = mysql_query("select p_data from photo where p_id='$p_id'",$connection);
    							$photo_result = mysql_fetch_array($photo_sql);
    							$my_data = $photo_result[p_data];
    							echo "$my_data";   							        						
        						?>" width="150"/>
        </div>
       <?php }?>
        
                <div class="weibo_button"><a href="javascript:void(0);z">转发(<?php 
                           /*显示转发次数*/
                           include_once("sql_connect.php");                                            
                            $w_id = $my_result[w_id];
                            /*检查weibo表中w_id（微博id）最大t_times（微博转发次数）*/
                            $weibo_sql = mysql_query("select t_times from weibo WHERE w_id = '$w_id'",$connection);	
                            $weibo_result = mysql_fetch_array($weibo_sql);
    						$weibo_data = $weibo_result[0];   						
    						echo "$weibo_data";
    						?>)</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:void(0);">收藏</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href = "javascript:void(0);">评论(<?php 
                           /*显示评论次数*/
                           include_once("sql_connect.php");                   
                            $w_id = $my_result[w_id];
                            /*检查comment表中w_id（微博id）最大w_ctimes（微博评论次数）*/
                            $comment_sql = mysql_query("select MAX(w_ctimes) from comment WHERE w_id = '$w_id'",$connection);	
                            $comment_result = mysql_fetch_array($comment_sql);
    						$comment_data = $comment_result[0];  
    						if ($comment_data){
    							echo "$comment_data";
    						}
    						else echo "0";
    						?>)</a></div>
        <div class="weibo_time">
        <?php include_once 'timeConverter.php';	echo timeConverter($my_result[w_date]);?></div>
        <div id="comment_box">
        <div class="comment_bg">
        <span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
        <div contenteditable="true" type="text" name="comment_info" class="comment_info" ></div>
        <input name="speach_submit" class="comment_submit" id="comment_submit" type="button" value="评 论" />
        
         <div id="comment_wrap">       
        <?php 	
        /*微博评论显示*/
		include_once 'sql_connect.php';
		include_once 'msg_redirect.php';
		include_once 'timeConverter.php';
        $comment_sql = mysql_query("SELECT c_id,c_content,c_date,u_no,r_id FROM comment WHERE w_id='$my_result[w_id]'",$connection);	
        $comment_result = mysql_fetch_array($comment_sql);
		if($comment_result){
			do {
				if($comment_result[r_id]=="0"){
		?>
			
			<div class="comment_sbox">
            <div class="comment_border"></div>
			<div class="comment_img"><a href="#"><img src="<?php 
					/*显示头像*/
        			$show_head_sql = mysql_query("select h_data from head where u_no='$comment_result[u_no]'",$connection);
    				$show_head_result = mysql_fetch_array($show_head_sql);
    				$my_data = $show_head_result[h_data];
    				if (!$my_data){
    					echo "head_image/09.jpg";
    					}
    				else echo "$my_data";
					?>" alt="" title="" width="30" height="30" border="0" /></a></div>

					<div class="comment_content">
					<?php 
					/*显示人名*/
					$show_user = mysql_query("select u_name from user_info where u_no = '$comment_result[u_no]'",$connection);
					$show_user_result = mysql_fetch_array($show_user);
					echo $show_user_result[0].":".$comment_result[c_content]."(".timeConverter($comment_result[c_date]).")";?>
					</div>                                        
				</div>
					
		<?php 
				}
				else{
					?>
			<div class="comment_sbox">
            <div class="comment_border"></div>
			<div class="comment_img"><a href="#"><img src="<?php 
					/*显示头像*/
        			$show_head_sql = mysql_query("select h_data from head where u_no='$comment_result[u_no]'",$connection);
    				$show_head_result = mysql_fetch_array($show_head_sql);
    				$my_data = $show_head_result[h_data];
    				if (!$my_data){
    					echo "head_image/09.jpg";
    					}
    				else echo "$my_data";
					?>" alt="" title="" width="30" height="30" border="0" /></a></div>

					<div class="comment_content">
					<?php 
					/*显示人名*/
					$show_user = mysql_query("select u_name from user_info where u_no = '$comment_result[u_no]'",$connection);
					$show_user_result = mysql_fetch_array($show_user);
					echo $show_user_result[0].":";
					$comment_sql2= mysql_query("select u_name from user_info where u_no in(select u_no from comment where c_id='$comment_result[r_id]')",$connection);
					$comment_result2 = mysql_fetch_array($comment_sql2);
					echo "回复@".$comment_result2[u_name].":".$comment_result[c_content]."(".timeConverter($comment_result[c_date]).")";?>
					</div>                                        
				</div>
			<?php 	}
				}while ($comment_result = mysql_fetch_array($comment_sql));
			}
		?>
        </div>
        <s><i></i></s>
		</div>
        </div>
        <div class="weibo_border"></div>
		<div id="zhuanfa_box">
			<span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
			<div class="zhuanfa_titlebox">
    			<div class="zhuanfa_title">转发</div>
        		<div class="zhuanfa_close"><a href="javascript:void(0)">关闭</a></div>
    		</div>
    		<div id="speach_expression" class="speach_image"><a href = "javascript:void(0)" ><img src="image/face.jpg" width="18" height="18" /></a></div>
    		<div class="zhuanfa_tips">还能输入<span id="counter">140</span>字</div>
<!--    		<div contenteditable="true" type="text" name="zhuanfa_info" class="zhuanfa_info" id="zhuanfa_info"></div>-->
			<textarea name="zhuanfa_info" class="zhuanfa_info" id="zhuanfa_info"></textarea>
    		<input name="zhuanfa_submit" class="zhuanfa_submit" id="zhuanfa_submit" type="button" value="转 发" />   
		</div>
		<div id="transpond_face">
        		<div class="face_title">常用表情</div>
        		<div class="face_close"><a href="javascript:void(0)">关闭</a></div>
        		<div class="face_content">
    				<?php 
    				/*输出表情*/
    				include_once 'sql_connect.php';
    				include_once 'msg_redirect.php';
    				$tHead_sql = mysql_query("select * from expression",$connection);
    				$tHead_result = mysql_fetch_array($tHead_sql);
    				if($tHead_result){
    					do{
    				?>
    						<div class="face_img"><a href="javascript:void(0)">
    							<?php echo "<img src='".$tHead_result[e_url]."' name='".$tHead_result[e_name]."'/>"?>
    							</a>
    						</div>
    				<?php 
    					}
    					while($tHead_result = mysql_fetch_array($tHead_sql));
    				}
    				?>
				</div>
        	</div>  


        
         
    </div>
    <?php 
    }while ($my_result=mysql_fetch_array($my_sql));}
	?>
    </div>    
        </div>
        <div style="display:none;">
        <div id="weibo_box"><?php 
    /*循环输出热门评论的内容，同时输出头像，昵称，发布微博的时间*/
    include_once 'sql_connect.php'; 
    include_once 'msg_redirect.php';
	$u_no = $_COOKIE['u_no'];
    
    $my_sql = mysql_query("SELECT weibo.*,max(w_ctimes) FROM weibo,comment  where  weibo.w_id=comment.w_id group by w_id order by max(w_ctimes) desc LIMIT 0,10",$connection);
		
    $my_result = mysql_fetch_array($my_sql);
    if($my_result){
    do{
    ?>
   	<div class="weibo_box">
   		<span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
    	<div class="hot_img">
        <div class="hot_img1"><?php 
                           /*显示评论次数*/
                           include_once("sql_connect.php");                   
                            $w_id = $my_result[w_id];
                            /*检查comment表中w_id（微博id）最大w_ctimes（微博评论次数）*/
                            $comment_sql = mysql_query("select MAX(w_ctimes) from comment WHERE w_id = '$w_id'",$connection);	
                            $comment_result = mysql_fetch_array($comment_sql);
    						$comment_data = $comment_result[0];   						
    						echo "$comment_data";
    						?></div>
        <div class="hot_img2">评论</div>
        </div>
        <div class="weibo_content">        
        	    <?php
        	    /*输出昵称和微博内容*/ 
        	    include_once 'utilities/show_expression.php';
        	    include_once 'sql_connect.php';
        	    $u_no = $my_result['u_no'];
        	   	$user_sql = mysql_query("select u_name from user_info where u_no='$u_no'",$connection);
    			$user_result = mysql_fetch_array($user_sql);
    			$user_data = $user_result[0];   						
	    		echo "<font color='#06f'>".$user_data."</font>".": ".show_expression($my_result[w_content]);
	    		?>
	    
	    <?php 
        /*转发的显示*/
        include_once("sql_connect.php");
        
        $t_id = $my_result[t_id];
        
        if($t_id !="0"){
        	do{
        	include_once("sql_connect.php");
      	
        	$weibo_sql= mysql_query("SELECT weibo.u_no,w_content,w_date,u_name,h_id,w_id,t_id,p_id FROM weibo,user_info WHERE w_id='$t_id' AND user_info.u_no IN(SELECT u_no FROM weibo WHERE w_id='$t_id')");
        	$weibo_result2= mysql_fetch_array($weibo_sql);
        	
        	$t_id =$weibo_result2[t_id];
        	/*判断是不是最终的微博*/
        	if($t_id =="0"){ 
        	/*最终的微博,另开一个框*/ ?>
            			 
       	    <div class='weibo_t_content'>
            <div class='weibo_t_bg'> 
			<?php   
        	include_once 'utilities/show_expression.php';
	        echo "<font color='#06f'>"."@".$weibo_result2[u_name]."</font>".": ".show_expression($weibo_result2[w_content]);
	        				        
	        ?>
            
			<div class='weibo_t_photo'><img <?php if($weibo_result2[p_id]!="0"){
								/*输出相片*/
        						include_once 'sql_connect.php'; 
        						$p_id= $weibo_result2['p_id'];
    							$photo_sql2 = mysql_query("select p_data from photo where p_id='$p_id'",$connection);
    							$photo_result2 = mysql_fetch_array($photo_sql2);
    							$my_data = $photo_result2[p_data];
    							echo "src='";
    							echo "$my_data";   
								echo "'"."width='150'";			
									}	?> /></div>
			<div class='weibo_t_button'>转发(<?php 
                           /*显示转发次数*/
                           include_once("sql_connect.php");                                            
                            $w_id = $weibo_result2[w_id];
                            /*检查weibo表中w_id（微博id）最大t_times（微博转发次数）*/
                            $weibo_sql = mysql_query("select t_times from weibo WHERE w_id = '$w_id'",$connection);	
                            $weibo_result = mysql_fetch_array($weibo_sql);
    						$weibo_data = $weibo_result[0];   						
    						echo "$weibo_data";
    						?>)&nbsp;|&nbsp;评论(<?php 
    						/*显示评论次数*/
                           include_once("sql_connect.php");                   
                            $w_id = $weibo_result2[w_id];
                            /*检查comment表中w_id（微博id）最大w_ctimes（微博评论次数）*/
                            $comment_sql = mysql_query("select MAX(w_ctimes) from comment WHERE w_id = '$w_id'",$connection);	
                            $comment_result = mysql_fetch_array($comment_sql);
    						$comment_data = $comment_result[0];   						
    						echo "$comment_data";
    						?>)</div> 
			<div class='weibo_t_time'> <?php include_once 'timeConverter.php';	echo timeConverter($weibo_result2[w_date]);?></div>	    	 
			<s><i></i></s>
            </div> 
			</div>  <?php 
        	} 
        	else {	            
        	/*如果不是最终微博,则直接输出*/	       
        	echo "<span class=''>";        
        	include_once 'utilities/show_expression.php';
	    	echo "<font color='#06f'>"."@".$weibo_result2[u_name]."</font>".": ".show_expression($weibo_result2[w_content]);
	   		echo " </span> ";	
        	}
        	
        	
        	}while($t_id);
        }
        ?>    
	    
        </div>
         <?php 
        $p_id= $my_result['p_id'];
        if($p_id!="0"){
        
        ?>
        
        <div class="weibo_photo"><img src="<?php
        						/*输出相片*/
        						include_once 'sql_connect.php'; 
        						$p_id= $my_result['p_id'];
    							$photo_sql = mysql_query("select p_data from photo where p_id='$p_id'",$connection);
    							$photo_result = mysql_fetch_array($photo_sql);
    							$my_data = $photo_result[p_data];
    							echo "$my_data";   							        						
        						?>" width="150"/>
        </div>
       <?php }?>
	    
        
        <div class="weibo_button"><a href="##">转发(<?php 
        					/*显示转发次数*/
                           include_once("sql_connect.php");                                            
                            $w_id = $my_result[w_id];
                            /*检查weibo表中w_id（微博id）最大t_times（微博转发次数）*/
                            $weibo_sql = mysql_query("select t_times from weibo WHERE w_id = '$w_id'",$connection);	
                            $weibo_result = mysql_fetch_array($weibo_sql);
    						$weibo_data = $weibo_result[0];   						
    						echo "$weibo_data";
        ?>)</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="##">收藏</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href = "##">评论(<?php 
        $w_id = $my_result[w_id];
                            /*检查comment表中w_id（微博id）最大w_ctimes（微博评论次数）*/
                            $comment_sql = mysql_query("select MAX(w_ctimes) from comment WHERE w_id = '$w_id'",$connection);	
                            $comment_result = mysql_fetch_array($comment_sql);
    						$comment_data = $comment_result[0];  
    						if ($comment_data){
    							echo "$comment_data";
    						}
    						else echo "0";
        ?>)</a></div>
        <div class="weibo_time">
        <?php include_once 'timeConverter.php';	echo timeConverter($my_result[w_date]);?></div>
        <div id="comment_box">
        <div class="comment_bg">
        <span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
        <div contenteditable="true" type="text" name="comment_info" class="comment_info" ></div>
        <input name="speach_submit" class="comment_submit" id="comment_submit" type="button" value="评 论" />
        
   
        <div id="comment_wrap">       
        <?php 	
        /*评论微博显示*/
		include_once 'sql_connect.php';
		include_once 'msg_redirect.php';
		include_once 'timeConverter.php';
        $comment_sql = mysql_query("SELECT c_content,c_date,u_no FROM comment WHERE w_id='$my_result[w_id]'",$connection);	
        $comment_result = mysql_fetch_array($comment_sql);
		if($comment_result){
			do {
		?>
			
			<div class="comment_sbox">
            <div class="comment_border"></div>
			<div class="comment_img"><a href="#"><img src="<?php 
					/*显示头像*/
        			$show_head_sql = mysql_query("select h_data from head where u_no='$comment_result[u_no]'",$connection);
    				$show_head_result = mysql_fetch_array($show_head_sql);
    				$my_data = $show_head_result[h_data];
    				if (!$my_data){
    					echo "head_image/09.jpg";
    					}
    				else echo "$my_data";
					?>" alt="" title="" width="30" height="30" border="0" /></a></div>

					<div class="comment_content">
					<?php 
					/*显示人名*/
					$show_user = mysql_query("select u_name from user_info where u_no = '$comment_result[u_no]'",$connection);
					$show_user_result = mysql_fetch_array($show_user);
					echo $show_user_result[0].":".$comment_result[c_content]."(".timeConverter($comment_result[c_date]).")";?>
					</div>                                        
				</div>
					
		<?php 
				}while ($comment_result = mysql_fetch_array($comment_sql));
			}
		?>
        </div>
        <s><i></i></s>
		</div>
        </div>
        <div class="weibo_border"></div>
		<div id="zhuanfa_box">
			<span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
			<div class="zhuanfa_titlebox">
    			<div class="zhuanfa_title">转发</div>
        		<div class="zhuanfa_close"><a href="javascript:void(0)">关闭</a></div>
    		</div>
    		<div id="speach_expression" class="speach_image"><a href = "javascript:void(0)" ><img src="image/face.jpg" width="18" height="18" /></a></div>
    		<div class="zhuanfa_tips">还能输入<span id="counter">140</span>字</div>
<!--    		<div contenteditable="true" type="text" name="zhuanfa_info" class="zhuanfa_info" id="zhuanfa_info"></div>-->
			<textarea name="zhuanfa_info" class="zhuanfa_info" id="zhuanfa_info"></textarea>
    		<input name="zhuanfa_submit" class="zhuanfa_submit" id="zhuanfa_submit" type="button" value="转 发" />   
		</div>
		<div id="transpond_face">
        		<div class="face_title">常用表情</div>
        		<div class="face_close"><a href="javascript:void(0)">关闭</a></div>
        		<div class="face_content">
    				<?php 
    				/*输出表情*/
    				include_once 'sql_connect.php';
    				include_once 'msg_redirect.php';
    				$tHead_sql = mysql_query("select * from expression",$connection);
    				$tHead_result = mysql_fetch_array($tHead_sql);
    				if($tHead_result){
    					do{
    				?>
    						<div class="face_img"><a href="javascript:void(0)">
    							<?php echo "<img src='".$tHead_result[e_url]."' name='".$tHead_result[e_name]."'/>"?>
    							</a>
    						</div>
    				<?php 
    					}
    					while($tHead_result = mysql_fetch_array($tHead_sql));
    				}
    				?>
				</div>
        	</div>
        </div>
    <?php 
    }while ($my_result=mysql_fetch_array($my_sql));}
	?>
    </div>		
        </div>
	</div>
	</div>
   
   </div><!-- end of center content -->




            
   </div><!-- end of main content -->
   
   
   
   <div class="footer">深圳大学计算机与软件学院@毕业设计项目网站<br />指导老师：王华明<br />项目负责：陈作鑫<br />
    小组成员：陈作鑫&nbsp;&nbsp;陈志杰&nbsp;&nbsp;赖晓东
    </div>                 


</div>
<!-- end of main_container -->
</body>
</html>